package com.liuxinlong.jobs;

import com.liuxinlong.modules.dao.FileManageDao;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service;

/**
 * 使用quartz框架
 */
@Service
@Slf4j
@Component("fileCleanTask")
public class FileCleanTask {

    @Autowired
    private FileManageDao fileManageDao;

    /**
     * 业务逻辑
     */
    public void reptilian(){
        log.info("fileCleanJob start...");
//        List<FileManage> fileManageList = fileManageDao.getJunkFiles();
//        String currentDate = TimeUtils.getDate(TimeFormatConstants.YYYY_MM_DD);
//        for (UserStandardPermission up: fileManageList) {
//            String expireDate = up.getExpireTime().substring(0,10);
//            if (StringUtils.compare(currentDate,expireDate) > 0) {
//                userStandardPermissionDao.deleteById(up.getId());
//            }
//        }
        log.info("expireFilePermissionJob end...");
    }
}

